package com.tsll.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName book
 */
public class Book implements Serializable {
    private Integer shu;

    public Integer getShu() {
        return shu;
    }

    public void setShu(Integer shu) {
        this.shu = shu;
    }

    /**
     * 书id
     */
    private Integer bookId;

    /**
     * 书名
     */
    private String bookName;

    /**
     * 书作者
     */
    private String bookAuthor;

    /**
     * 书描述
     */
    private String bookDescribe;


    /**
     * 书发布日期
     */
    @DateTimeFormat(pattern= "yyyy-MM-dd")
    @JsonFormat(pattern= "yyyy-MM-dd",timezone = "GMT+8")
    private Date bookRedate;

    /**
     * 书价格
     */
    private Double bookPrice;

    /**v
     * 书类型
     */
    private Integer booktypeId;

    /**
     * 书数量
     */
    private Integer bookCount;

    /**
     * 书图片
     */
    private String bookIco;

    /**
     * 书类型实体类
     */

    private Booktype booktype;

    /**
     * 统计相同bookid的书本借阅次数
     */
    private Integer count;
    /**
     * 借阅图书
     */
    private BorrowBook borrowbook;
    private Integer clearCount;
    private Integer repairCount;
    /**
     * 用户
     */
    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public BorrowBook getBorrowbook() {
        return borrowbook;
    }

    public void setBorrowbook(BorrowBook borrowbook) {
        this.borrowbook = borrowbook;
    }

    /**
     * 校验数量
     */
    private Integer verifyCount;

    private Integer damageSum;



    /**
     *报损数量
     */
    private  Integer damageCount;

    public Integer getVerifyCount() {
        return verifyCount;
    }

    public void setVerifyCount(Integer verifyCount) {
        this.verifyCount = verifyCount;
    }

    public Integer getDamageCount() {
        return damageCount;
    }

    public void setDamageCount(Integer damageCount) {
        this.damageCount = damageCount;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getClearCount() {
        return clearCount;
    }

    public void setClearCount(Integer clearCount) {
        this.clearCount = clearCount;
    }

    public Integer getRepairCount() {
        return repairCount;
    }

    public void setRepairCount(Integer repairCount) {
        this.repairCount = repairCount;
    }

    public Integer getDamageSum() {
        return damageSum;
    }

    public void setDamageSum(Integer damageSum) {
        this.damageSum = damageSum;
    }

    public Book() {
    }

    public Book(Integer bookId, String bookName, String bookAuthor, String bookDescribe, Date bookRedate, Double bookPrice, Integer booktypeId, Integer bookCount, String bookIco, Booktype booktype, Integer count, BorrowBook borrowbook, User user) {
        this.bookId = bookId;
        this.bookName = bookName;
        this.bookAuthor = bookAuthor;
        this.bookDescribe = bookDescribe;
        this.bookRedate = bookRedate;
        this.bookPrice = bookPrice;
        this.booktypeId = booktypeId;
        this.bookCount = bookCount;
        this.bookIco = bookIco;
        this.booktype = booktype;
        this.count = count;
        this.borrowbook = borrowbook;
        this.user = user;
    }

    public Book(Integer bookId, String bookName, String bookAuthor, String bookDescribe, Date bookRedate, Double bookPrice, Integer booktypeId, Integer bookCount, String bookIco, Booktype booktype) {
        this.bookId = bookId;
        this.bookName = bookName;
        this.bookAuthor = bookAuthor;
        this.bookDescribe = bookDescribe;
        this.bookRedate = bookRedate;
        this.bookPrice = bookPrice;
        this.booktypeId = booktypeId;
        this.bookCount = bookCount;
        this.bookIco = bookIco;
        this.booktype = booktype;
    }

    public Date getBookRedate() {
        return bookRedate;
    }

    public void setBookRedate(Date bookRedate) {
        this.bookRedate = bookRedate;
    }

    public Booktype getBooktype() {
        return booktype;
    }

    public void setBooktype(Booktype booktype) {
        this.booktype = booktype;
    }



    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Integer getBookId() {
        return bookId;
    }

    /**
     * 
     */
    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    /**
     * 
     */
    public String getBookName() {
        return bookName;
    }

    /**
     * 
     */
    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    /**
     * 
     */
    public String getBookAuthor() {
        return bookAuthor;
    }

    /**
     * 
     */
    public void setBookAuthor(String bookAuthor) {
        this.bookAuthor = bookAuthor;
    }

    /**
     * 
     */
    public String getBookDescribe() {
        return bookDescribe;
    }

    /**
     * 
     */
    public void setBookDescribe(String bookDescribe) {
        this.bookDescribe = bookDescribe;
    }

    /**
     * 
     */
    public Double getBookPrice() {
        return bookPrice;
    }

    /**
     * 
     */
    public void setBookPrice(Double bookPrice) {
        this.bookPrice = bookPrice;
    }

    /**
     * 
     */
    public Integer getBooktypeId() {
        return booktypeId;
    }

    /**
     * 
     */
    public void setBooktypeId(Integer booktypeId) {
        this.booktypeId = booktypeId;
    }

    /**
     * 
     */
    public Integer getBookCount() {
        return bookCount;
    }

    /**
     * 
     */
    public void setBookCount(Integer bookCount) {
        this.bookCount = bookCount;
    }

    /**
     * 
     */
    public String getBookIco() {
        return bookIco;
    }

    /**
     * 
     */
    public void setBookIco(String bookIco) {
        this.bookIco = bookIco;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Book other = (Book) that;
        return (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
            && (this.getBookName() == null ? other.getBookName() == null : this.getBookName().equals(other.getBookName()))
            && (this.getBookAuthor() == null ? other.getBookAuthor() == null : this.getBookAuthor().equals(other.getBookAuthor()))
            && (this.getBookDescribe() == null ? other.getBookDescribe() == null : this.getBookDescribe().equals(other.getBookDescribe()))
            && (this.getBookPrice() == null ? other.getBookPrice() == null : this.getBookPrice().equals(other.getBookPrice()))
            && (this.getBooktypeId() == null ? other.getBooktypeId() == null : this.getBooktypeId().equals(other.getBooktypeId()))
            && (this.getBookCount() == null ? other.getBookCount() == null : this.getBookCount().equals(other.getBookCount()))
            && (this.getBookIco() == null ? other.getBookIco() == null : this.getBookIco().equals(other.getBookIco()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
        result = prime * result + ((getBookName() == null) ? 0 : getBookName().hashCode());
        result = prime * result + ((getBookAuthor() == null) ? 0 : getBookAuthor().hashCode());
        result = prime * result + ((getBookDescribe() == null) ? 0 : getBookDescribe().hashCode());
        result = prime * result + ((getBookPrice() == null) ? 0 : getBookPrice().hashCode());
        result = prime * result + ((getBooktypeId() == null) ? 0 : getBooktypeId().hashCode());
        result = prime * result + ((getBookCount() == null) ? 0 : getBookCount().hashCode());
        result = prime * result + ((getBookIco() == null) ? 0 : getBookIco().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bookId=").append(bookId);
        sb.append(", bookName=").append(bookName);
        sb.append(", bookAuthor=").append(bookAuthor);
        sb.append(", bookDescribe=").append(bookDescribe);
        sb.append(", bookPrice=").append(bookPrice);
        sb.append(", booktypeId=").append(booktypeId);
        sb.append(", bookCount=").append(bookCount);
        sb.append(", bookIco=").append(bookIco);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}